package com.common.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import org.apache.log4j.Logger;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

public class XmlUtil {
	private static Logger log = Logger.getLogger(XmlUtil.class);
	public static Document loadXML(String xmlfile) {
		SAXReader reader = new SAXReader();
		Document doc=null;
		try {
			doc = reader.read(new FileInputStream(xmlfile));
		} catch (FileNotFoundException e) {
			log.error(e.getMessage());
		} catch (DocumentException e) {
			log.error(e.getMessage());
		}
		return doc;
	}
}
